﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddJobPlan.aspx.cs" Inherits="Quartz.Web.AddJobPlan" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="script/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="css/common.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="script/ligerUI/js/core/base.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //加载是否重复执行
            var IsRepeat = 0;
            fnIsRepeat();
            if (IsRepeat == "1") {
                //加载间隔频率
                var JobRepeatIntervalType = instance[0].JobRepeatIntervalType;
                var IntervalWeek = instance[0].IntervalWeek.split(",");
                //alert("JobRepeatIntervalType:" + JobRepeatIntervalType + " IntervalWeek:" + IntervalWeek);
                fnJobRepeatIntervalType();
                for (var i = 0; i < IntervalWeek.length; i++) {
                    if (IntervalWeek[i] == "1") $("#chk1").attr("checked", 'true');
                    if (IntervalWeek[i] == "2") $("#chk2").attr("checked", 'true');
                    if (IntervalWeek[i] == "3") $("#chk3").attr("checked", 'true');
                    if (IntervalWeek[i] == "4") $("#chk4").attr("checked", 'true');
                    if (IntervalWeek[i] == "5") $("#chk5").attr("checked", 'true');
                    if (IntervalWeek[i] == "6") $("#chk6").attr("checked", 'true');
                    if (IntervalWeek[i] == "7") $("#chk7").attr("checked", 'true');
                }
                if (JobRepeatIntervalType == "EveryMonth") {
                    //运行间隔为每月时，加载月执行频率
                    var IntervalMonthType = instance[0].IntervalMonthType;
                    fnIntervalMonthType();
                }

                var EverydayIntervalType = instance[0].EverydayIntervalType;
                fnEverydayIntervalType();
            }
            //加载计划组
            var url = "quartz.aspx";
            var param = [
                { name: "flag", value: "GetTriggerGroupNameLists" },
				{ name: "r", value: Math.random()}];
            $.ajax({
                type: 'post',
                url: url,
                data: param,
                dataType: "json",
                success: function (data) {
                    if (data == null || data.length == 0) return;
                    for (var p in data) {
                        $("#selectPlanGroup").append("<option title='" + data[p] + "'>" + data[p] + "</option>");
                    }
                    $("#PlanGroup").val(data[0]);
                },
                error: function (data) {
                }
            });
        });

        //是否重复执行任务
        var fnIsRepeat = function () {
            var IsRepeat = $("#IsRepeat").val();
            //alert("IsRepeat:" + IsRepeat);
            if (IsRepeat == "0") {
                $("#trJobRepeatIntervalType").hide();
                $("#trJobRepeatInterval").hide();
                $("#trIntervalWeek").hide();
                $("#trIntervalMonthType").hide();
                $("#trIntervalMonthDay").hide();
                $("#trIntervalMonthWeek").hide();
                $("#trEverydayIntervalType").hide();
                $("#trEverydayIntervalFrmTime").hide();
                $("#trEverydayIntervalEndTime").hide();
                $("#trEverydayInterval").hide();

            }
            else {
                $("#trJobRepeatIntervalType").show();
                $("#trJobRepeatInterval").show();
                $("#trIntervalWeek").show();
                $("#trIntervalMonthType").show();
                $("#trIntervalMonthDay").show();
                $("#trIntervalMonthWeek").show();
                $("#trEverydayIntervalType").show();
                $("#trEverydayIntervalFrmTime").show();
                $("#trEverydayIntervalEndTime").show();
                $("#trEverydayInterval").show();
                fnJobRepeatIntervalType();
            }

        }

        //运行间隔类型
        var fnJobRepeatIntervalType = function () {
            var JobRepeatIntervalType = $("#JobRepeatIntervalType").val();
            //alert("JobRepeatIntervalType:" + JobRepeatIntervalType);
            if (JobRepeatIntervalType == "EveryDay") {
                $("#trIntervalWeek").hide();
                $("#trIntervalMonthType").hide();
                $("#trIntervalMonthDay").hide();
                $("#trIntervalMonthWeek").hide();

            }
            else if (JobRepeatIntervalType == "EveryWeek") {
                $("#trIntervalWeek").show();
                $("#trIntervalMonthType").hide();
                $("#trIntervalMonthDay").hide();
                $("#trIntervalMonthWeek").hide();
            }
            else if (JobRepeatIntervalType == "EveryMonth") {
                $("#trIntervalWeek").hide();
                $("#trIntervalMonthType").show();
                $("#trIntervalMonthDay").show();
                $("#trIntervalMonthWeek").hide();
                fnIntervalMonthType();
            } else {
                $("#trIntervalWeek").show();
                $("#trIntervalMonthType").show();
                $("#trIntervalMonthDay").show();
                $("#trIntervalMonthWeek").show();
            }
        }

        //每月执行频率类型
        var fnIntervalMonthType = function () {
            var IntervalMonthType = $("#IntervalMonthType").val();
            //alert("IntervalMonthType:" + IntervalMonthType);
            if (IntervalMonthType == "1") {
                $("#trIntervalMonthDay").show();
                $("#trIntervalMonthWeek").hide();
            }
            else {
                $("#trIntervalMonthDay").hide();
                $("#trIntervalMonthWeek").show();
            }
        }

        //每天重复执行
        var fnEverydayIntervalType = function () {
            var EverydayIntervalType = $("#EverydayIntervalType").val();
            //alert("EverydayIntervalType:" + EverydayIntervalType);
            if (EverydayIntervalType == "1") {
                $("#trEverydayInterval").show();
            }
            else {
                $("#trEverydayInterval").hide();
            }
        }

        //设置周频率
        var SetIntervalWeek = function () {
            var str = "";
            $("input:checkbox[name='checkbox']:checked").each(function () {
                str += $(this).val() + ",";
            });
            if (str != "") str = str.substr(0, str.length - 1);
            //alert(str);
            $("#IntervalWeek").val(str);
        }

        //数据验证
        var fnCheckData = function () {
            try {
                if ($("#PlanName").val() == "") {
                    return "任务名不能为空！";
                }

                var reg = /^\d+(\.\d+)?$/;
                if ($("#JobRepeatInterval").val() != "") {
                    if (reg.test($("#JobRepeatInterval").val()) == false) {
                        return "运行间隔需要输入非零数字!";
                    }
                }
            }
            catch (e)
            { }
        }

        //生成任务计划
        function CreateTaskPlan() {
            //alert("**");
            //debugger;
            var msg = fnCheckData();
            if (typeof (msg) != "undefined" && msg != "") {
                alert(msg);
                return;
            }
            var taskPlan = "任务";
            var cronExp = "";
            var JobRepeatIntervalType = $("#JobRepeatIntervalType").val();
            var JobRepeatInterval = $("#JobRepeatInterval").val();
            var EverydayIntervalType = $("#EverydayIntervalType").val();
            var EverydayIntervalFrmTime = $("#EverydayIntervalFrmTime").val();
            var EverydayIntervalEndTime = $("#EverydayIntervalEndTime").val();
            var EverydayInterval = $("#EverydayInterval").val();
            var EverydayIntervalUnit = $("#EverydayIntervalUnit").val();
            var strEverydayIntervalUnit = "";
            switch (EverydayIntervalUnit) {
                case "H":
                    strEverydayIntervalUnit = "小时";
                    break;
                case "M":
                    strEverydayIntervalUnit = "分";
                    break;
                case "S":
                    strEverydayIntervalUnit = "秒";
                    break;
            }

            //周频率
            var IntervalWeek = $("#IntervalWeek").val().split(",");
            var strIntervalWeek = "";
            for (var i = 0; i < IntervalWeek.length; i++) {
                if (IntervalWeek[i] == "1") strIntervalWeek += "星期日,";
                if (IntervalWeek[i] == "2") strIntervalWeek += "星期一,";
                if (IntervalWeek[i] == "3") strIntervalWeek += "星期二,";
                if (IntervalWeek[i] == "4") strIntervalWeek += "星期三,";
                if (IntervalWeek[i] == "5") strIntervalWeek += "星期四,";
                if (IntervalWeek[i] == "6") strIntervalWeek += "星期五,";
                if (IntervalWeek[i] == "7") strIntervalWeek += "星期六,";
            }

            //月频率
            var IntervalMonthType = $("#IntervalMonthType").val();
            var IntervalMonthDay = $("#IntervalMonthDay").val();
            var NumWeekDay = $("#NumWeekDay").val();
            var strNumWeekDay = "";
            var IntervalMonthWeek = $("#IntervalMonthWeek").val();
            var strIntervalMonthWeek = "";
            switch (NumWeekDay) {
                case "1":
                case "2":
                case "3":
                case "4":
                    strNumWeekDay = "第" + NumWeekDay + "个";
                    break;
                case "5":
                    strNumWeekDay = "最后一个";
                    break;
            }
            switch (IntervalMonthWeek) {
                case "1":
                    strIntervalMonthWeek = "周一";
                    break;
                case "2":
                    strIntervalMonthWeek = "周二";
                    break;
                case "3":
                    strIntervalMonthWeek = "周三";
                    break;
                case "4":
                    strIntervalMonthWeek = "周四";
                    break;
                case "5":
                    strIntervalMonthWeek = "周五";
                    break;
                case "6":
                    strIntervalMonthWeek = "周六";
                    break;
                case "7":
                    strIntervalMonthWeek = "周日";
                    break;
                case "8":
                    strIntervalMonthWeek = "工作日";
                    break;
                case "9":
                    strIntervalMonthWeek = "休息日";
                    break;
            }

            //开始组装计划
            taskPlan += $("#PlanName").val() + "";
            taskPlan += "在" + $("#PlanStartTime").val() + "";
            taskPlan += "和" + $("#PlanEndTime").val() + "之间使用计划.";

            //格式化字符串
            var JobStartDateDate = $("#PlanStartTime").val().split(" ")[0].split("-");
            var JobStartDateTime = $("#PlanEndTime").val().split(" ")[1].split(":");
            var arrEverydayIntervalFrmTime = EverydayIntervalFrmTime.split(":");
            var arrEverydayIntervalEndTime = EverydayIntervalEndTime.split(":");

            if ($("#IsRepeat").val() == "1") {
                if (JobRepeatIntervalType == "EveryDay") {
                    if (EverydayIntervalType == "1") {
                        //每3天在07:04和19:10之间、每隔3分执行.
                        taskPlan += "每" + JobRepeatInterval + "天在" + EverydayIntervalFrmTime + "和" + EverydayIntervalEndTime + "之间、每隔" +
                                EverydayInterval + strEverydayIntervalUnit + "执行.";
                        switch (EverydayIntervalUnit) {
                            case "H":
                                cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + "/" + EverydayInterval + " "
                        + "1/" + JobRepeatInterval + " " + "*" + " " + "?" + " " + "*";
                                break;
                            case "M":
                                cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + "/" + EverydayInterval + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + " "
                        + "1/" + JobRepeatInterval + " " + "*" + " " + "?" + " " + "*";
                                break;
                            case "S":
                                cronExp = "0" + "/" + EverydayInterval + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + " "
                        + "1/" + JobRepeatInterval + " " + "*" + " " + "?" + " " + "*";
                                break;
                        }
                    }
                    else {
                        //每3天在07:04执行.
                        taskPlan += "每" + JobRepeatInterval + "天在" + EverydayIntervalFrmTime + "执行.";
                        cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + " " + arrEverydayIntervalFrmTime[0] * 1 + " "
                    + "1/" + JobRepeatInterval + " " + "*" + " " + "?" + " " + "*";
                    }
                }
                else if (JobRepeatIntervalType == "EveryWeek") {
                    if (EverydayIntervalType == "1") {
                        //每3周的星期一,星期三,星期六,星期日,在07:04和19:10之间、每隔3分执行.
                        taskPlan += "每" + JobRepeatInterval + "周的" + strIntervalWeek + "在" + EverydayIntervalFrmTime + "和" + EverydayIntervalEndTime + "之间、每隔" +
                                EverydayInterval + strEverydayIntervalUnit + "执行.";
                        switch (EverydayIntervalUnit) {
                            case "H":
                                cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + "/" + EverydayInterval + " "
                        + "?" + " " + "*" + " " + IntervalWeek + "/" + JobRepeatInterval + " " + "*";
                                break;
                            case "M":
                                cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + "/" + EverydayInterval + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + " "
                        + "?" + " " + "*" + " " + IntervalWeek + "/" + JobRepeatInterval + " " + "*";
                                break;
                            case "S":
                                cronExp = "0" + "/" + EverydayInterval + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + " "
                        + "?" + " " + "*" + " " + IntervalWeek + "/" + JobRepeatInterval + " " + "*";
                                break;
                        }
                    }
                    else {
                        //每3周的星期一,星期三,星期四,在07:04执行.
                        taskPlan += "每" + JobRepeatInterval + "周的" + strIntervalWeek + "在" + EverydayIntervalFrmTime + "执行.";
                        cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + " " + arrEverydayIntervalFrmTime[0] * 1 + " "
                    + "?" + " " + "*" + " " + IntervalWeek + "/" + JobRepeatInterval + " " + "*";
                    }
                }
                else if (JobRepeatIntervalType == "EveryMonth") {
                    if (IntervalMonthType == "1") {
                        if (EverydayIntervalType == "1") {
                            //每3个月,于当月第3天,在07:04和19:10之间、每隔3分执行.
                            taskPlan += "每" + JobRepeatInterval + "个月,于当月第" + IntervalMonthDay + "天,在" + EverydayIntervalFrmTime + "和" + EverydayIntervalEndTime + "之间、每隔" +
                                EverydayInterval + strEverydayIntervalUnit + "执行.";
                            switch (EverydayIntervalUnit) {
                                case "H":
                                    cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + "/" + EverydayInterval + " "
                        + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + "?" + " " + "*";
                                    break;
                                case "M":
                                    cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + "/" + EverydayInterval + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + " "
                        + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + "?" + " " + "*";
                                    break;
                                case "S":
                                    cronExp = "0" + "/" + EverydayInterval + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + " "
                        + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + "?" + " " + "*";
                                    break;
                            }
                        }
                        else {
                            //每3个月,于当月第3天,在07:04执行.
                            taskPlan += "每" + JobRepeatInterval + "个月,于当月第" + IntervalMonthDay + "天,在" + EverydayIntervalFrmTime + "执行.";
                            cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + " " + arrEverydayIntervalFrmTime[0] * 1 + " "
                    + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + "?" + " " + "*";
                        }
                    }
                    else {
                        if (EverydayIntervalType == "1") {
                            //每3个月的第1个周三,在07:04和19:10之间、每隔3分执行.
                            taskPlan += "每" + JobRepeatInterval + "个月的" + strNumWeekDay + strIntervalMonthWeek + ",在" + EverydayIntervalFrmTime + "和" + EverydayIntervalEndTime + "之间、每隔" +
                                EverydayInterval + strEverydayIntervalUnit + "执行.";
                            if (NumWeekDay < 5) {
                                //每月的第几个周几
                                switch (EverydayIntervalUnit) {
                                    case "H":
                                        cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + "/" + EverydayInterval + " "
                        + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + IntervalMonthWeek + "#" + NumWeekDay + " " + "*";
                                        break;
                                    case "M":
                                        cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + "/" + EverydayInterval + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + " "
                        + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + IntervalMonthWeek + "#" + NumWeekDay + " " + "*";
                                        break;
                                    case "S":
                                        cronExp = "0" + "/" + EverydayInterval + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + " "
                        + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + IntervalMonthWeek + "#" + NumWeekDay + " " + "*";
                                        break;
                                }
                            }
                            else {
                                //每月的最后周几
                                switch (EverydayIntervalUnit) {
                                    case "H":
                                        cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + "/" + EverydayInterval + " "
                        + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + IntervalMonthWeek + "L" + " " + "*";
                                        break;
                                    case "M":
                                        cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + "/" + EverydayInterval + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + " "
                        + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + IntervalMonthWeek + "L" + " " + "*";
                                        break;
                                    case "S":
                                        cronExp = "0" + "/" + EverydayInterval + " " + arrEverydayIntervalFrmTime[1] * 1 + "-" + arrEverydayIntervalEndTime[1] * 1 + " "
                        + arrEverydayIntervalFrmTime[0] * 1 + "-" + arrEverydayIntervalEndTime[0] * 1 + " "
                        + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + IntervalMonthWeek + "L" + " " + "*";
                                        break;
                                }
                            }
                        }
                        else {
                            //每3个月的第2个周三,在07:04执行.
                            taskPlan += "每" + JobRepeatInterval + "个月的" + strNumWeekDay + strIntervalMonthWeek + ",在" + EverydayIntervalFrmTime + "执行.";
                            if (NumWeekDay < 5) {
                                //每月的第几个周几
                                cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + " " + arrEverydayIntervalFrmTime[0] * 1 + " "
                        + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + IntervalMonthWeek + "#" + NumWeekDay + " " + "*";
                            }
                            else {
                                //每月的最后周几
                                cronExp = "0" + " " + arrEverydayIntervalFrmTime[1] * 1 + " " + arrEverydayIntervalFrmTime[0] * 1 + " "
                        + IntervalMonthDay + " " + "1/" + JobRepeatInterval + " " + IntervalMonthWeek + "L" + " " + "*";
                            }
                        }
                    }
                }
                taskPlan += "";
            }
            else {
                taskPlan = "任务" + $("#PlanName").val() + "在" + $("#PlanStartTime").val() + " 运行一次";
                cronExp = "0" + " " + JobStartDateTime[1] * 1 + " " + JobStartDateTime[0] * 1 + " "
                    + JobStartDateDate[2] * 1 + " " + JobStartDateDate[1] * 1 + " " + "?" + " " + JobStartDateDate[0] * 1;
            }
            $("#PlanDes").val(taskPlan);
            $("#CronExp").val(cronExp);

        }
    </script>

    <style type="text/css">
       td
       {
           height:30px;
       }
       .td_text
       {
           text-align:left;
           font-size:13px;
           width:150px;
       }
       .td_value
       {
           text-align:left;
           font-size:13px;
           width:200px;
       }
       .inputMain
       {
           width:200px;
           text-align:left;
       }
       .selectMain
       {
           width:204px;
           text-align:left;
       }
    </style>
</head>
<body>
  <form id="form">
   <div align="left" style="width:95%;margin:0px 0px 0px 10px;">
    <table cellpadding="0" cellspacing="0">
		<tbody>
            <tr>
              <td class="td_text">
					计划名称：</td>
			  <td class="td_value">
					<input class="inputMain" id="PlanName" type="text" /></td>
            </tr>
            <tr>
              <td class="td_text">
					所属分组：</td>
			  <td class="td_value">
					<div style="position:relative;"> 
                    <span style="margin-left:194px;width:18px;overflow:hidden;"> 
                    <select class="selectMain" id="selectPlanGroup" style="margin-left:-194px;" onchange="this.parentNode.nextSibling.value=this.options[this.selectedIndex].text;"></select>
                    </span>
                    <input id="PlanGroup" type="text" style="width:183px;height:19px;position:absolute;left:0px;" /> 
                    </div>
              </td>
            </tr>
			<tr>
				<td class="td_text">
					计划类型：</td>
				<td class="td_value">
					<select class="selectMain" id="IsRepeat" name="IsRepeat" onchange="fnIsRepeat();"><option selected="selected" value="1">重复执行</option><option value="0">执行一次</option></select></td>
			</tr>
            <tr>
              <td class="td_text" width="200">
					计划开始时间：</td>
			  <td class="td_value">
					<input class="inputMain" id="PlanStartTime" type="text" /></td>
            </tr>
            <tr>
              <td class="td_text">
					计划结束时间：</td>
			  <td class="td_value">
					<input class="inputMain" id="PlanEndTime" type="text" /></td>
            </tr>
            <tr>
				<td class="td_text">
					执行状态：</td>
				<td class="td_value">
					<select class="selectMain" id="PlanStatus" ><option selected="selected" value="1">等待执行</option><option value="0">立即执行</option></select></td>
			</tr>
			<tr id="trJobRepeatIntervalType">
				<td class="td_text">
					执行频率：</td>
				<td class="td_value">
					<select class="selectMain" id="JobRepeatIntervalType" name="JobRepeatIntervalType" onchange="fnJobRepeatIntervalType();"><option selected="selected" value="EveryDay">每天</option><option value="EveryWeek">每周</option><option value="EveryMonth">每月</option></select></td>
			</tr>
            <tr>
            <td class="td_text">
					执行间隔：</td>
				<td class="td_value">
					<input class="inputMain" id="JobRepeatInterval" name="JobRepeatInterval" type="text" /></td>
            </tr>
			<tr id="trIntervalWeek" style="display: none">
				<td class="td_text">
					周执行频率：</td>
				<td class="td_value">
					<input class="inputMain" id="IntervalWeek" name="IntervalWeek" type="hidden" /> <input id="chk2" name="checkbox" onclick="SetIntervalWeek();" type="checkbox" value="2" />周一 <input id="chk3" name="checkbox" onclick="SetIntervalWeek();" type="checkbox" value="3" />周二 <input id="chk4" name="checkbox" onclick="SetIntervalWeek();" type="checkbox" value="4" />周三 <input id="chk5" name="checkbox" onclick="SetIntervalWeek();" type="checkbox" value="5" />周四 <input id="chk6" name="checkbox" onclick="SetIntervalWeek();" type="checkbox" value="6" />周五 <input id="chk7" name="checkbox" onclick="SetIntervalWeek();" type="checkbox" value="7" />周六 <input id="chk1" name="checkbox" onclick="SetIntervalWeek();" type="checkbox" value="1" />周日</td>
			</tr>
			<tr id="trIntervalMonthType" style="display: none">
				<td class="td_text">
					月执行频率：</td>
				<td class="td_value">
					<select class="selectMain" id="IntervalMonthType" name="IntervalMonthType" onchange="fnIntervalMonthType();"><option selected="selected" value="1">天</option><option value="2">周</option></select></td>
			</tr>
			<tr id="trIntervalMonthDay" style="display: none">
				<td class="td_text">
					每月第：</td>
				<td class="td_value">
					<input style="width:160px;" id="IntervalMonthDay" name="IntervalMonthDay" type="text" /> 天执行</td>
			</tr>
			<tr id="trIntervalMonthWeek" style="display: none">
				<td class="td_text">
					每月：</td>
				<td class="td_value">
					<select style="width:120px;" id="NumWeekDay" name="NumWeekDay"><option selected="selected" value="1">第一个</option><option value="2">第二个</option><option value="3">第三个</option><option value="4">第四个</option><option value="5">最后一个</option></select>
                    <select id="IntervalMonthWeek" name="IntervalMonthWeek" style="width: 80px" title="月间隔时，按周执行时的周间隔频率"><option selected="selected" value="2">周一</option><option value="3">周二</option><option value="4">周三</option><option value="5">周四</option><option value="6">周五</option><option value="7">周六</option><option value="1">周日</option></select></td>
			</tr>
			<tr id="trEverydayIntervalType">
				<td class="td_text">
					每天重复执行：</td>
				<td class="td_value">
					<select style="width:44px;" id="EverydayIntervalType" name="EverydayIntervalType" onchange="fnEverydayIntervalType();"><option selected="selected" value="1">是</option><option value="0">否</option></select>
                    时间&nbsp;&nbsp;<input id="EverydayIntervalFrmTime" style="width: 50px;" title="每天开始时间" type="text" /> -&nbsp;<input id="EverydayIntervalEndTime" style="width: 50px" title="每天结束时间" type="text" /></td>
			</tr>
			<tr id="trEverydayInterval">
				<td class="td_text">
					每天间隔频率：</td>
				<td class="td_value">
					<input style="width:120px;" id="EverydayInterval" name="EverydayInterval" type="text" /> 
                    <select style="width:76px;" id="EverydayIntervalUnit" name="EverydayIntervalUnit" ><option selected="selected" value="H">小时</option><option value="M">分</option><option value="S">秒</option></select></td>
			</tr> 
			<tr>
				<td class="td_text">
					计划说明：</td>
				<td class="td_value">
                    <textarea cols="50" id="PlanDes" readonly="readonly" rows="3"></textarea>
                    <input class="inputMain" id="CronExp" name="CronExp" readonly="readonly" style="width: 200px" title="任务格式化字符串" type="text" />
                    <input id="btnCronExp" onclick="CreateTaskPlan();" type="button" value="生成任务计划" /></td>
			</tr>
		</tbody>
	</table>
    </div>
  </form>
</body>
</html>
